#!perl
use strict;
use warnings;

use MT::Test tests    => 16;
use MT::Bootstrap App => 'MT::Tool';

map {
    run_test_tmpl(sub { tmpl($_) })
  } (
     'TestLayoutIfEQ test="1"',
     'TestLayoutIfNE test="0"',
     'TestLayoutIfLT test="0"',
     'TestLayoutIfGT test="2"',
     'TestLayoutIfLE test="1"',
     'TestLayoutIfGE test="1"',
     'TestLayoutIfLE test="0"',
     'TestLayoutIfGE test="2"',
     'TestLayoutUnlessEQ test="1"',
     'TestLayoutUnlessNE test="0"',
     'TestLayoutUnlessLT test="0"',
     'TestLayoutUnlessGT test="2"',
     'TestLayoutUnlessLE test="1"',
     'TestLayoutUnlessGE test="1"',
     'TestLayoutUnlessLE test="0"',
     'TestLayoutUnlessGE test="2"'
  );

sub tmpl {
    my $tag = $_[0];
    my ($name) = $tag =~ m/(^[\S]+)/;
"<MTTestIs test_name=\"$name\" value=\"TRUE\"><\$MT$tag\$><\$MTGetVar name=\"VALUE\"\$></MTTestIs>";
}
